package com.zjx.springcloud.controller;


import com.baomidou.kisso.common.util.RandomUtil;

import com.google.gson.Gson;
import com.zjx.springcloud.constant.HttpCode;
import com.zjx.springcloud.entities.Dept;
import com.zjx.springcloud.entities.ResultVO;
import com.zjx.springcloud.entities.test.Test;
import com.zjx.springcloud.redis.RedisUtil;
import com.zjx.springcloud.service.DeptService;
import com.zjx.springcloud.utils.LanguageUtils;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.client.solrj.response.UpdateResponse;
import org.apache.solr.common.SolrDocument;
import org.apache.solr.common.SolrDocumentList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.List;

/**
 * spring boot demo 接口
 */
@SuppressWarnings("all")
@RestController
@RequestMapping("/user")
public class LoginApiController {

       @Autowired
       private RedisUtil redisUtil;
    @RequestMapping(value = "/login")
    public ResultVO queryAll(
            User user
        ) {
        String uid = "10001";
        String token = RandomUtil.getCharacterAndNumber(10);
        String accessToken = uid + "#" + token;
        System.err.println("缓存票据主键：accessToken=" + accessToken);


        redisUtil.set("","");



        return new ResultVO(HttpCode.REQUEST_SUCCESS_CODE, LanguageUtils.getDefaultText("success"));

    }

}
